﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;
using System.IO;
using System.Web.SessionState;
using NetWing.Model;
using NetWing.Bll;
using Omu.ValueInjecter;
using NetWing.BPM.Core;
using NetWing.BPM.Core.Bll;
using NetWing.Common;
using NetWing.Common.Data;
using NetWing.Common.Data.SqlServer;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using NetWing.Common.Excel;
using NetWing.Common.IO;
using NetWing.Common.IO.DirFile;
using NetWing.Common.Data.Filter;
using NetWing.BPM.Core.Bll;
using NetWing.BPM.Core.Model;
using NetWing.BPM.Core.Dal;

namespace NetWing.BPM.Admin.mjrooms.ashx
{
    /// <summary>
    /// qianfei 的摘要说明
    /// </summary>
    public class qianfei : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");
            string keyid = context.Request["keyid"];
            if (!string.IsNullOrEmpty(keyid))
            {
                DataRow dr = SqlEasy.ExecuteDataRow("select * from MJOrder where keyid="+keyid+"");
                if (dr["isqian"].ToString()==""||dr["isqian"].ToString()=="费用正常")
                {
                    SqlEasy.ExecuteNonQuery("update MJOrder set isqian='欠费' where keyid=" + keyid + "");
                    context.Response.Write("{\"status\":1,\"msg\":\"处理成功！\"}");
                }
                else
                {
                    SqlEasy.ExecuteNonQuery("update MJOrder set isqian='费用正常' where keyid=" + keyid + "");
                    context.Response.Write("{\"status\":1,\"msg\":\"处理成功！\"}");
                }
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}